package demo;

import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;



public class RestaurantQuery extends HttpServlet {

	private static String RestaurantSelected = null;
	
	public static String getRestaurantSelected(){
		return RestaurantSelected;
	}
	
	public static void SetRestaurantSelected(String restaurantID)
	{
		RestaurantSelected = restaurantID;
	}

	/**
	 * Process the HTTP Post request
	 * 
	 * @param request
	 *            an object holding the information sent by the client
	 * @param response
	 *            an object holding the information sent to the client
	 * @throws ServletException
	 *             , IOException
	 */
	public void doPost(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {

		response.setContentType("text/html");
		
		PrintWriter out = response.getWriter();
		RestaurantSelected = request.getParameter("Restaurant_Enter");		
		
		
		try {
			out.println("<script>window.location.href='../customer_page.jsp';</script>");
			//out.println("<SCRIPT language=javascript>window.open ('../customer_page.jsp')</SCRIPT>");
		} catch (Exception ex) {
			out.println("Error Here: " + ex.getMessage());
		} finally {
			out.close(); // Close stream
		}
	}
}

	